package org.lisen.patterndemo.observer.v02;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class MyFrame extends Frame {

    public void showMe() {
        Button button = new Button("Button");
        button.addActionListener(new MyFrameListener01());
        button.addActionListener(new MyFrameListener02());
        this.add(button);
        this.pack();

        this.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

        this.setSize(300, 200);
        this.setLocation(500,500);
        this.setVisible(true);

    }

}
